package com.mikasa.springboot.example.controller;

import com.mikasa.springboot.example.kafka.KafkaSender;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: zhangyu
 * @Date: 17/4/28.
 * @Description:
 */

@RestController
@RequestMapping("/kafka")
public class KafkaController {

    @Autowired
    private KafkaSender kafkaSender;

    @ApiOperation(value="测试kafka", notes="kafka")
    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public Object test() {
        Map<String,Object> map = new HashMap<String,Object>();
        kafkaSender.sendMessage();
        map.put("result","success");
        return map;
    }
}
